package cn.com.ntr.jhclient.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.com.ntr.jhclient.R;
import cn.com.ntr.jhclient.model.Trade;

public class TradeAdapter extends EnhancedAdapter<Trade> {
	private boolean isClick=false;
	public TradeAdapter(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}
	public void addAll(List<Trade> list){
		this.dataList=list;
	}
	@Override
	protected void bindView(View paramView, Context paramContext, int position) {
		// TODO Auto-generated method stub
		Trade trade=getItem(position);
		final ViewHolder holder=(ViewHolder)paramView.getTag();
	
//		if(isClick){
//			holder.correct.setVisibility(View.VISIBLE);
//		}
		holder.tvTrade.setText(trade.gettName());
	}

	@Override
	protected View newView(Context context, int i, ViewGroup viewgroup) {
		// TODO Auto-generated method stub
		View view=LayoutInflater.from(mContext).inflate(R.layout.simple_list_item_4,null);
		ViewHolder holder=new ViewHolder();
		holder.rela=(RelativeLayout)view.findViewById(R.id.rela_parent);
		holder.tvTrade=(TextView)view.findViewById(R.id.tv_trade);
		holder.correct=(ImageView)view.findViewById(R.id.arrow_item_1);
		view.setTag(holder);
		return view;
	}
	private class ViewHolder{
		RelativeLayout rela;
		TextView tvTrade;
		ImageView correct;
	}
		
}
